import QtQuick 2.0
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2

Item {
    id: root
    width: 800; height: 100

    property string majorText : "Display"
    property string minorText: "General"
    property color textColor: "white"
    property color backColor: "black"
    property color btnColor: "grey"
    signal returnBtnClicked()

    Rectangle{
        id: rootRect
        width: root.width; height: root.height
        anchors.fill: parent
        color: backColor
        Rectangle{
            id: labelRect
            width: rootRect.width/2; height: rootRect.height
            anchors.left: parent.left
            color: backColor
            Text {
                id: label
                text: majorText + "(" + minorText + ")"
                anchors.verticalCenter: labelRect.verticalCenter
                anchors.left: labelRect.left
                anchors.leftMargin: labelRect.width/20
                font {bold: true; pixelSize: 26}
                color: "blue"
            }
        }

        Rectangle{
            id: btnRect
            width: rootRect.width/4; height: rootRect.height
            color: backColor
            anchors.right: rootRect.right
            anchors.verticalCenter: rootRect.verticalCenter
            Button{
                id: returnBtn
                Text {
                    text: "Return"
                    anchors.centerIn: parent
                    font {bold: true; pixelSize: 26}
                    color: textColor
                }
                width: parent.width*0.6
                height: parent.height*0.6
                anchors.centerIn: parent
                style: btnStyle
                onClicked: returnBtnClicked()
            }
            Component{
                id: btnStyle
                ButtonStyle{
                    background: Rectangle{
                        border.color: "white"
                        border.width: control.hovered ? 2 : 1
                        color: control.hovered? Qt.darker(btnColor, 2) : btnColor
                        radius: 5
                    }
                }
            }
        }
    }
}
